home *** CD-ROM | disk | FTP | other *** search
- #ifndef FWBREAKC_H
- #define FWBREAKC_H
-
- //========================================================================================
- //
- // File: FWBreakC.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: (c) 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWAUTODE_H
- #include "FWAutoDe.h"
- #endif
-
- #ifndef FWEXCDEF_H
- #include "FWExcDef.h"
- #endif
-
- #ifndef FW_NATIVE_EXCEPTIONS
-
- #ifndef FWCLAINF_H
- #include "FWClaInf.h"
- #endif
-
- #endif // FW_NATIVE_EXCEPTIONS
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- //========================================================================================
- // CLASS FW_CExceptionThrowPoint
- //
- // A helper class for exception debugging.
- // See the macro FW_DECLARE_THROW_POINT and FW_CHECK_THROW_POINT
- //========================================================================================
-
- #ifdef FW_DEBUG
-
- /* FW_CExceptionThrowPoint can be declared globally and will insert
- themselves into a global linked list. This list can be iterated
- over and individual throw points can be set to throw an exception
- when checked.
- Be aware that in a shared library situation this list will be
- global to the *process*, not just the part. Therefore a throw
- point in shared code may be triggered by a different part
- exersizing the same code.
- */
-
- class FW_CLASS_ATTR FW_CExceptionThrowPoint
- {
- public:
- FW_CExceptionThrowPoint (const char * name);
- ~FW_CExceptionThrowPoint ();
- void Check ();
- inline void ThrowWhenChecked (FW_Boolean throwOrNot);
- inline const char * GetName () const;
- inline FW_Boolean HasBeenChecked () const;
- inline FW_Boolean WillThrowWhenChecked () const;
- inline FW_CExceptionThrowPoint * Next () const;
- static inline FW_CExceptionThrowPoint * First ();
- private:
- const char * fName;
- FW_Boolean fHasBeenChecked;
- FW_Boolean fThrowWhenChecked;
- FW_CExceptionThrowPoint * fNext, * fPrevious;
- static FW_CExceptionThrowPoint * gFirst;
- };
-
- #endif
-
- #ifndef FW_NATIVE_EXCEPTIONS
-
- //========================================================================================
- // CLASS FW_CExceptionBreakContext
- //
- // A helper class for exception debugging. See the macro FW_EXCEPTION_BREAK_CONTEXT
- //========================================================================================
-
- #ifdef FW_DEBUG
- class FW_CLASS_ATTR FW_CExceptionBreakContext FW_AUTO_DESTRUCT_OBJECT
- {
- public:
- FW_CExceptionBreakContext(FW_ClassInfoPtr breakExceptionKind);
- virtual ~ FW_CExceptionBreakContext();
-
- private:
- FW_ClassInfoPtr fLastBreakExceptionKind;
- };
- #endif
-
- #endif // FW_NATIVE_EXCEPTIONS
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export off
- #endif
-
- //========================================================================================
- // FW_CExceptionThrowPoint Inlines
- //========================================================================================
-
- #ifdef FW_DEBUG
-
- inline void FW_CExceptionThrowPoint::ThrowWhenChecked (FW_Boolean throwOrNot) {
- fThrowWhenChecked = throwOrNot;
- }
-
- inline const char * FW_CExceptionThrowPoint::GetName () const {
- return fName;
- }
-
- inline FW_Boolean FW_CExceptionThrowPoint::HasBeenChecked () const {
- return fHasBeenChecked;
- }
-
- inline FW_Boolean FW_CExceptionThrowPoint::WillThrowWhenChecked () const {
- return fThrowWhenChecked;
- }
-
- inline FW_CExceptionThrowPoint * FW_CExceptionThrowPoint::Next () const {
- return fNext;
- }
-
- #endif // FW_DEBUG
-
- #endif
-
-